package com.qinggeng.project.system.service;

import com.qinggeng.project.system.domain.GoodsKeep;
import com.qinggeng.project.system.domain.Orders;

import java.util.List;

/**
 * 商品库存信息Service接口
 *
 * @author qinggeng
 * @date 2020-06-15
 */
public interface IGoodsKeepService
{
    /**
     * 查询商品库存信息
     *
     * @param keepId 商品库存信息ID
     * @return 商品库存信息
     */
    public GoodsKeep selectGoodsKeepById(Long keepId);

    /**
     * 查询商品库存信息列表
     *
     * @param goodsKeep 商品库存信息
     * @return 商品库存信息集合
     */
    public List<GoodsKeep> selectGoodsKeepList(GoodsKeep goodsKeep);

    /**
     * 新增商品库存信息
     *
     * @param goodsKeep 商品库存信息
     * @return 结果
     */
    public int insertGoodsKeep(GoodsKeep goodsKeep);

    /**
     * 修改商品库存信息
     *
     * @param goodsKeep 商品库存信息
     * @return 结果
     */
    public int updateGoodsKeep(GoodsKeep goodsKeep);

    /**
     * 批量删除商品库存信息
     *
     * @param keepIds 需要删除的商品库存信息ID
     * @return 结果
     */
    public int deleteGoodsKeepByIds(Long[] keepIds);

    /**
     * 删除商品库存信息信息
     *
     * @param keepId 商品库存信息ID
     * @return 结果
     */
    public int deleteGoodsKeepById(Long keepId);

    GoodsKeep selectGoodsKeepByGoodsId(Long goodsId,Long shopId);


    /**
     * 减少库存
     * @param goodsId
     * @param shopId
     * @param goodsNum
     * @return
     */
    int subKeepNum(Long goodsId, Long shopId, Integer goodsNum);

    /**
     * 减少库存
     * @param goodsId
     * @param shopId
     * @param goodsNum
     * @param keepNum
     * @return
     */
    int subKeepNum(Long goodsId, Long shopId,Integer keepNum, Integer goodsNum);

    /**
     * 添加库存
     * @param goodsId
     * @param shopId
     * @param goodsNum
     * @return
     */
    int addKeepNum(Long goodsId, Long shopId, Integer goodsNum);

    int addKeepNum(Orders orders);

    /**
     * 销量增加
     * @param number
     */
    void updateGoodsKeepAutoAddSale(Integer number);



}
